//
//  Extension.swift
//  LeetCodeDemo
//
//  Created by 杨冬武 on 2021/3/20.
//

import Foundation

extension Character {
    func toInt() -> Int {
        guard self.isASCII else {
            return -1
        }
        return Int(self.asciiValue! - Character("0").asciiValue!)
    }
}
